//
//  IMIDataAppDelegate.m
//  IMIData
//
//  Created by Travis on 09-8-17.
//  Copyright Exmart 2009. All rights reserved.
//

#import "AppDelegate.h"
#import "IMIData/IMIDataSQLite.h"
#import "IMIData/IMIDataXML.h"

@implementation AppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(UIApplication *)application {    
	window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
	window.backgroundColor = [UIColor whiteColor];
	window.multipleTouchEnabled=YES;
    [window makeKeyAndVisible];
	
	/*IMIDataSQLite *sl=[IMIDataSQLite databaseWithPath:@"/tmp/db.sqlite"];
	[sl open];
	IMIDataSQLiteResultSet *res=[sl executeQuery:@"select * from 'animals' limit 3,6"];
	while ([res next]) {
		NSLog([res stringForColumn:@"name"]);
	}
	[res close];*/
	
	IMIDataXML *xml=[[IMIDataXML alloc] initWithURL:[NSURL URLWithString:@"http://feeds.qzone.qq.com/cgi-bin/cgi_rss_out?uin=250144617"]];
	[xml addEventListener:self forKey:Event_IMIDataXML_Finish withFunction:@selector(onFinish:)];
}
- (void)onFinish:(NSEvent*)event{
	IMILog([event description]);
}
- (void)dealloc {
    [window release];
    [super dealloc];
}


@end
